﻿using ETHotfix;
using ETModel;

namespace DemoPathfinding.Hotfix.Handlers {

    /// <summary>
    /// "玩家从Gate服务器断开连接消息"为框架自动发出的,需要自定义接收的处理器
    /// </summary>
	[ActorMessageHandler(AppType.Map)]
	public class G2M_SessionDisconnectHandler : AMActorLocationHandler<MapPlayer, G2M_SessionDisconnect>
	{
		protected override void Run(MapPlayer mapPlayer, G2M_SessionDisconnect message) {
            //简单的从map端移除玩家即可,之后可以拓展成支持断线重连等
            Game.Scene.GetComponent<MapPlayersComponent>().Remove(mapPlayer.Id);
        }
	}
}